Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hljs Theme Support #147

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

hljs Theme Support #147

wants to merge 8 commits into from

Conversation

Lachee
Copy link

@Lachee Lachee commented Sep 3, 2019

Added support for Highlight.JS themes. The results can be seen below. Basically added additional class names to the nodes to match hljs stylesheets, created a options page to show theme selection and some other minor css tweaks to get it to work. The manifest has been updated to include a new storage and web-accessible-resources to accommodate for theme selection.

The readme has also been updated to include working examples of JSON files.

Examples:

dark theme
a light theme
a blue theme
options

@broofa
Copy link

broofa commented Dec 26, 2019

This adds a lot of unnecessary file bloat. Worse, it creates additional maintenance burden for this project. As styles are added/removed/updated on the HighlighJS site, this project will be expected to follow suit.

My suggestion: Implement a generic theming feature that allows for the specification of a background color, JSON key color, and colors for each of the 5 JSON types. These can get stored in whatever local storage mechanism is available to chrome extensions. For the UI, there should be 10-12 out-of-the-box themes users can choose from (5-6 light, 5-6 dark), and a "custom" option that lets them set the colors manually. (using HTML5 color inputs).

For HighlightJS support, the "custom" UI could include an option for loading the color fields from one of the HighlightJS themes. But the HighlightJS themes and theme colors should all be fetched dynamically from the HightightJS github repo. (You can get a list of themes and download urls for each theme at this Github API url. This will avoid the aforementioned maintenance burden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants